<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('/login', 'Auth\LoginController@login');
Route::post('/logout', 'Auth\LoginController@logout')->name('logout');

Route::group(['middleware' => 'auth'], function () {

    Route::get('/', 'HomeController@index')->name('admin.home');

    Route::get('/order', 'OrderController@index')->name('admin.order');
    Route::get('/order/detail', 'OrderController@detail')->name('admin.order.detail');
    Route::post('/order/checkout', 'OrderController@checkout')->name('admin.order.checkout');
    Route::any('/order/fail_checkout', 'OrderController@fail_checkout')->name('admin.order.fail_checkout');
    Route::any('/order/cancel', 'OrderController@cancel')->name('admin.order.cancel');

    Route::get('/driver', 'DriverController@index')->name('admin.driver');
    Route::any('/driver/add', 'DriverController@add')->name('admin.driver.add');
    Route::any('/driver/edit', 'DriverController@edit')->name('admin.driver.edit');
    Route::any('/driver/end_trip', 'DriverController@end_trip')->name('admin.driver.end_trip');

    Route::get('/line', 'LineController@index')->name('admin.line');
    Route::any('/line/add', 'LineController@add')->name('admin.line.add');
    Route::any('/line/edit', 'LineController@edit')->name('admin.line.edit');

    Route::any('/set','SetController@index')->name('admin.set');

});
